///*
// * Copyright 2016-2018 TVI Go Easy.
// * Created on 2018/2/1 14:36
// */
//package com.tvi.cloud.oauth2.config;
//
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.authentication.AuthenticationManager;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
//import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;
//import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
//
///**
// * 请在此写下该类的说明
// *
// * @author mechanic
// */
//@Configuration
//public class OAuth2Configuration extends AuthorizationServerConfigurerAdapter {
//
//    private final AuthenticationManager authenticationManager;
//    private final UserDetailsService userDetailsService;
//
//
//    public OAuth2Configuration(AuthenticationManager authenticationManager, UserDetailsService userDetailsService) {
//        this.authenticationManager = authenticationManager;
//        this.userDetailsService = userDetailsService;
//    }
//
//    @Override
//    public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
//        clients.inMemory()
//                .withClient("cloud-example")
//                .secret("example-secret")
//                .authorizedGrantTypes("refresh_token", "password", "client_credentials")
//                .scopes("web", "mobile");
//    }
//
//    @Override
//    public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
//        endpoints
//                .authenticationManager(authenticationManager)
//                .userDetailsService(userDetailsService);
//    }
//}
